//
//  ZCView.m
//  项目三
//
//  Created by rimi1 on 2016/12/9.
//  Copyright © 2016年 Wangxingqian. All rights reserved.
//

#import "FourView.h"

static NSInteger spacing_ = 10;

@implementation FourView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.collectButton];
        [self addSubview:self.comButton];
    }
    return self;
}

#pragma mark - get


- (UIButton *)collectButton {
    
    if (!_collectButton) {
        
        _collectButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.height, self.bounds.size.height)];
        [_collectButton setImage:[UIImage imageNamed:@"未收藏"] forState:UIControlStateNormal];
        [_collectButton setImage:[UIImage imageNamed:@"已收藏"] forState:UIControlStateSelected];
        _collectButton.tag = 100;
        
    }
    return _collectButton;
}

- (WXQButton *)comButton {
    
    if (!_comButton) {
        
        CGFloat width = self.collectButton.bounds.size.width;
        _comButton = [[WXQButton alloc] initWithFrame:CGRectMake(width + spacing_ * 2, 0, (self.bounds.size.width - width)/2, self.bounds.size.height) title:@"" titleColor:[UIColor blackColor] imageName:@"评论" imageLocation:WXQImageLocationLeft];
        _comButton.tag = 101;
        
    }
    return _comButton;
}

@end













